package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.DeliveryOrderDO;
import com.ssy.lingxi.order.entity.DeliveryOrderProductDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *  送货单-物理信息Jpa仓库
 * @author ds
 * @date 2022/3/24
 * @version 2.0.0
 */
@Repository
public interface DeliveryOrderProductRepository extends JpaRepository<DeliveryOrderProductDO, Long>, JpaSpecificationExecutor<DeliveryOrderProductDO> {

    @Transactional
    void deleteByDeliveryOrder(DeliveryOrderDO order);

    List<DeliveryOrderProductDO> findByDeliveryOrderAndIdIn(DeliveryOrderDO order,List<Long> ids);

    List<DeliveryOrderProductDO> findByDeliveryOrder(DeliveryOrderDO order);
}
